<?php

/**
 * Description of deepLinkReservationShowAction
\* www.teuker.nl - mail@teuker.nl
 * 
 * @author francisc
 */

class deepLinkReservationShowAction extends sfAction {
    
    public function execute($request) {
        $token = $request->getParameter('token');
        
        $reservation = SqlEngine::getReservations(array('token' => $token));
        
        $this->form = new ReservationGuestForm();
        
        $this->form->setDefaults(array('date' => $reservation[0]['date'],
                                       'occasion' => $reservation[0]['occasion'],
                                       'person_no' => $reservation[0]['person_no'],
                                       'salutation' => $reservation[0]['salutation'],
                                       'name_first' => $reservation[0]['name_first'],
                                       'name_last' => $reservation[0]['name_last'],
                                       'name_company' => $reservation[0]['name_company'],
                                       'address' => $reservation[0]['address'],
                                       'phone' => $reservation[0]['phone'],
                                       'mobile' => $reservation[0]['mobile'],
                                       'email' => $reservation[0]['email'],
                                       'menu_id' => $reservation[0]['menu_id'],
                                       'comments_general' => $reservation[0]['comments_general'],
                                       'comments_diet' => $reservation[0]['comments_diet']));
    }
}
